package com.itheima.controller;

import com.itheima.pojo.Account;
import com.itheima.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class AccountController {
    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");
        AccountService bean = ac.getBean(AccountService.class);
        List<Account> all = bean.findAll();
        for (Account account : all) {
            System.out.println(account);
        }

    }
}
